<template>
  <div class="text-left padding-lr" v-loading.fullscreen.lock="loading">
    <div class="text-right">
      <el-row class="flex align-center">
        <el-col :span="10"></el-col>
        <el-col :span="2">
          <el-button size="mini" type="success" @click="repeatInfo">查询是否重复</el-button>
        </el-col>
        <el-col :span="3" v-if="customer.frozenState=='1'">
          <el-button size="mini" type="success" @click="updateFrozenState">解封</el-button>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
// import Table from "../../../../yg/layout/main/page/wrapper/Table.vue";
import { ajax } from "@/store/yg/common/utils";
import { m } from "@/store/yg/common/local";

export default {
  // components: { Table },
  props: ["field", "data"],
  data() {
    return {
      customer: {},
      loading:false
    };
  },
  mounted: function() {
    this.customer = this.$store.state.edit.row;
    //console.log(" customer:>> ", this.customer);
    //console.log("12 :>> ", 12);
  },
  methods: {
    m(k) {
      return m(k);
    },
    repeatInfo() {
      ajax("customerRepeat", this.customer).then(
        res => {
          if (res.code != 200) {
            this.$message.error(m(res.message));
          } else {
            this.$message.success("未发现重复信息");
          }
        },
        error => {
          console.log(error);
        }
      );
    },
    updateFrozenState(){
        let updateMap={
          id:this.customer.id,
          loginExceptionNum:0,
          frozenState:0
        };
       // console.log("updateMap>>>",updateMap)
        ajax("updateFrozenState", updateMap).then(
          res => {
            if (res.code == 200) {
              this.$message.success("解冻成功！");
            } else {
              this.$message.error(res.message);
            }
          },
          error => {
             console.log(error);
           }
        );
    }
  }
};
</script>

<style scoped>
/deep/ .el-tabs__nav.is-top {
  display: flex;
  flex-wrap: wrap;
}
</style>
